# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kdevelop
pkgver=23.08.4
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://www.kdevelop.org/"
pkgdesc="A featureful, plugin-extensible IDE for C/C++ and other programming languages"
license="GPL-2.0-or-later AND LGPL-2.0-or-later AND GFDL-1.2-only"
_llvmver=17
depends="indent"
makedepends="
	boost-dev
	clang
	clang$_llvmver-dev
	clang$_llvmver-static
	extra-cmake-modules
	grantlee-dev
	karchive5-dev
	kcmutils5-dev
	kconfig5-dev
	kcrash5-dev
	kdeclarative5-dev
	kdoctools5-dev
	kguiaddons5-dev
	kiconthemes5-dev
	kio5-dev
	kitemmodels5-dev
	kitemviews5-dev
	kjobwidgets5-dev
	knewstuff5-dev
	knotifications5-dev
	knotifyconfig5-dev
	kparts5-dev
	kservice5-dev
	ktexteditor5-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	libkomparediff2-dev
	libksysguard-dev
	llvm$_llvmver-dev
	llvm$_llvmver-gtest
	llvm$_llvmver-static
	qt5-qtbase-dev
	qt5-qtwebengine-dev
	samurai
	shared-mime-info
	threadweaver5-dev
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/kdevelop/kdevelop.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kdevelop-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
options="!check" # Broken

build() {
	CFLAGS="$CFLAGS -D_GNU_SOURCE" \
	CXXFLAGS="$CXXFLAGS -I/usr/lib/llvm$_llvmver/include" \
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
e5a1bf3b6c46006165a6169fdfe244d02bff945c8dd01d0b5897a0752b4759c03f58ce136e636366b14b3b27e91aa14b29b0f432589a2114f45fbdf2a3cf3135  kdevelop-23.08.4.tar.xz
"
